<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        div{
            position: relative;
        }
        div{
            width: 300px;
            height: 400px;
            border: 10px solid greenyellow;
            margin: 50px auto;
            /*定宽居中 适用于块元素*/

            /*text-align: center;*/
            /*文本居中 使用于行和文字*/
            /*line-height: 400px;*/

            
        }

        span:nth-child(1){
            position: relative;
            top: 0;
            left: 0;
        }
        span:nth-child(2){
            position: absolute;
            top: 0;
            right: 0;
        }
        span:nth-child(3){
            position: absolute;
            left: 0;
            bottom: 0;
        }
        span:nth-child(4){
            position: absolute;
            right: 0;
            bottom: 0;
        }

        section{
            position: absolute;
            top: 50%;
            left: 50%;
            border: 1px solid red;
        }
    </style>
</head>
<body>
    <div>
        <span>1111</span>
        <span>2222</span>
        <span>3333</span>
        <span>4444</span>
        <main>
            <section>section</section>
        </main>
    </div>
</body>
</html>